Skip to content

Conversation

@alex89lj
Copy link

hi , I can't get the correct result when I use Object.create.
for example:isPlainObject(Object.create({})) => false

@markerikson
Copy link
Contributor

We only use this in a couple places in our codebase, and I can't see any reason why we would need to be concerned with use of Object.create() in this case. Appreciate the PR, but I don't think this is something we need to add.

@alex89lj
Copy link
Author

I am very happy to receive your reply.We use this method to detect the props passed by the user. Lodash can judge correctly. Why don't we make it better?

@markerikson
Copy link
Contributor

Because it's not meaningfully needed in this case.

It's used in verifyPlainObject, which is called here:

verifyPlainObject(mergedProps, displayName, 'mergeProps')

and here:

verifyPlainObject(props, displayName, methodName)

Both of those places are exceedingly unlikely to be dealing with an Object.create() call.

@alex89lj
Copy link
Author

Ok.thank you for your reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants